create table RestaurantType
(
	 [RestaurantTypeId] int identity(1, 1) primary key
	,[RestaurantTypeName] nvarchar(128)
	,[CreatedBy] int
	,[CreatedDate] datetime
	,[UpdatedBy] int
	,[UpdatedDate] datetime
	,[Status] int
)
go

CREATE PROCEDURE RestaurantTypeGet
	@RestaurantTypeId int	
AS
SELECT *
FROM [RestaurantType]
WHERE [RestaurantType].[RestaurantTypeId] = @RestaurantTypeId
GO

CREATE PROCEDURE RestaurantTypeList
AS
SELECT *
FROM [RestaurantType]
ORDER BY [RestaurantTypeId] DESC
GO

CREATE PROCEDURE RestaurantTypeInsert
	 @RestaurantTypeName nvarchar(128)
	,@CreatedBy int
	,@CreatedDate datetime
	,@UpdatedBy int
	,@UpdatedDate datetime
	,@Status int
AS

INSERT INTO RestaurantType (
	 [RestaurantTypeName]
	,[CreatedBy]
	,[CreatedDate]
	,[UpdatedBy]
	,[UpdatedDate]
	,[Status]
	
) VALUES (
	 @RestaurantTypeName
	,@CreatedBy
	,@CreatedDate
	,@UpdatedBy
	,@UpdatedDate
	,@Status
	
)

select SCOPE_IDENTITY()
GO

CREATE PROCEDURE RestaurantTypeUpdate
	@RestaurantTypeId int, 
	@RestaurantTypeName nvarchar(128), 
	@CreatedBy int, 
	@CreatedDate datetime, 
	@UpdatedBy int, 
	@UpdatedDate datetime, 
	@Status int 

AS

UPDATE  RestaurantType SET
	    [RestaurantTypeName] = @RestaurantTypeName
	   ,[CreatedBy] = @CreatedBy
	   ,[CreatedDate] = @CreatedDate
	   ,[UpdatedBy] = @UpdatedBy
	   ,[UpdatedDate] = @UpdatedDate
	   ,[Status] = @Status
WHERE [RestaurantType].[RestaurantTypeId] = @RestaurantTypeId
GO

CREATE PROCEDURE RestaurantTypeDelete
	@RestaurantTypeId int   
AS
DELETE FROM RestaurantType
WHERE [RestaurantType].[RestaurantTypeId] = @RestaurantTypeId
GO
